package com.example.examsystem.repository;

import com.example.examsystem.model.ExamQuestion;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ExamQuestionRepository extends JpaRepository<ExamQuestion, Long> {
    
    List<ExamQuestion> findByExamIdOrderBySortOrder(Long examId);
    
    void deleteByExamId(Long examId);
    
    void deleteByExamIdAndQuestionId(Long examId, Long questionId);
    
    boolean existsByExamIdAndQuestionId(Long examId, Long questionId);
    
    long countByExamId(Long examId);
}